<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.kaishengit.entity.*" %>
<%@ page import="com.kaishengit.dao.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>目标界面</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		.mydiv{
			background-color:#ff7400;
			height:1000px;
		}
		.navbar-inner{
			border-radius:0px 0px;
		}
		#container{
			margin-top:60px;
			background-color:#bbd8e9;
			border-radius:5px 5px;
		}
		#header{
			margin-top:10px;
		}	
		#plist-top{
		
			background-color:#999;
		}
		#plist-body{
			background-color:#ccc;
			height:50px;
		}
		.span9{
			border-radius:5px 5px;
		}
		h3{
			margin-left:30px;
			display:inline;
		}
		.btn1{
			margin-left:700px;
		}
		#bodyer{
			margin-left:-20px;
		}
		.span4{
			background-color:#ccc;
			height:300px;			
		}
		.header001{
			height:30px;
			border-bottom:1px solid #ff7400;
			background-color:#999;
		}
		.span4 span{
			margin-left:1px;
		}
		.btn2{
			display:block;
			float:right;
		}
		.content{			
			width:280px;
		}
		.content p{
			line-height:20px;
		}
		#bodyer .span3 a{	
			margin:0px -35px 0px -35px;
		}
		.nav-header span{
			font-size:16px;
		}
	</style>
  </head>
  
  <body>
    
    <%@ include file="include/top.jsp" %>

	<div class="container" id="container">
		<div id="header">
			<%Project project=(Project)session.getAttribute("project"); %>
			<h3 style="font-size:30px;color:blue"><%=project.getPname() %></h3>
			<hr>
		</div>
		<div id="bodyer">
			<div class="container-fluid">
				<div class="row-fluid">
					
					<jsp:include page="include/side.jsp">
						<jsp:param value="goallist" name="tag"/>
					</jsp:include>
					
					<div class="span9">
						<div class="container" style="width:600px"> 
							<%
								Goal goal=(Goal)session.getAttribute("nowshowgoal");
							%>
								<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
									<li class="active">
										<a href="#"><i class="icon-list-alt"></i><%=goal.getGname() %></a>
									</li>
									<li style="float:right"><i class="icon-edit"></i><a href="tran.jspx?name=editgoal&goalid=<%=goal.getId() %>" class="link-black">编辑目标</a></li>
								</ul>
								<div style="border:1px solid #EAEAEA;border-top:none;height:100px" class="wall">
									<p>
									<%=goal.getGdescripe() %>						
									</p>
									<%
										TDao tdao=new TDao();
										List<Task> tlist=tdao.findByGoalid(goal.getId());
										double progress=0.0;
										if(tlist.size()!=0){
											for(Task t: tlist){
												progress+=t.getProgress();
											}
											progress/=tlist.size();
											
										}
									%>
									<div class="progress" style="width:400px">
										<div class="bar"style="width:<%=100*progress %>%;"></div>
									</div>
								  </div>
								<div>
								<div class="page-header">
									<a class="btn btn-success" href="tran.jspx?name=addtask&goalid=<%=goal.getId() %>"><i class="icon-plus icon-white"></i>添加新任务</a>
								</div>
									现有任务：
									<ul>
										<%
											EDao edao=new EDao();
											for(Task tas: tlist){
												Employee employee=edao.findById(tas.getEmployeeid());
										%>
										<li><a href="tran.jspx?name=goaledittask&nowtaskid=<%=tas.getId() %>"><%=tas.getTname() %>[<%=employee.getUsername()%>]</a><br/>
											已完成：
											<div class="progress" style="width:400px">
												<div class="bar"style="width:<%=100*tas.getProgress() %>%;"></div>
											</div>
										</li>	
										<%
											}
										%>
									</ul>
								</div>								
						</div>
					</div>
				</div>
			</div>
		</div>
		
	</div>
	
    
  </body>
</html>
